package fr.afcepf.ai89.esharing.metier;

import java.util.ArrayList;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import fr.afcepf.ai89.esharing.data.IDAOCategorieAem;
import fr.afcepf.ai89.esharing.data.IDAOCivilite;
import fr.afcepf.ai89.esharing.data.IDAOComplement;
import fr.afcepf.ai89.esharing.data.IDAOEmprunt;
import fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso;
import fr.afcepf.ai89.esharing.data.IDAOFrCommune;
import fr.afcepf.ai89.esharing.data.IDAOFrDepartement;
import fr.afcepf.ai89.esharing.data.IDAOFrRegion;
import fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis;
import fr.afcepf.ai89.esharing.data.IDAOMarque;
import fr.afcepf.ai89.esharing.data.IDAOMotivationAnnulation;
import fr.afcepf.ai89.esharing.data.IDAOMotivationRefus;
import fr.afcepf.ai89.esharing.data.IDAONoteAvis;
import fr.afcepf.ai89.esharing.data.IDAOTypeAem;
import fr.afcepf.ai89.esharing.entity.CategorieAem;
import fr.afcepf.ai89.esharing.entity.Civilite;
import fr.afcepf.ai89.esharing.entity.Complement;
import fr.afcepf.ai89.esharing.entity.Emprunt;
import fr.afcepf.ai89.esharing.entity.FrCodePostalAsso;
import fr.afcepf.ai89.esharing.entity.FrCommune;
import fr.afcepf.ai89.esharing.entity.FrDepartement;
import fr.afcepf.ai89.esharing.entity.FrRegion;
import fr.afcepf.ai89.esharing.entity.LibelleSousAvis;
import fr.afcepf.ai89.esharing.entity.Marque;
import fr.afcepf.ai89.esharing.entity.MotivationAnnulation;
import fr.afcepf.ai89.esharing.entity.MotivationRefus;
import fr.afcepf.ai89.esharing.entity.NoteAvis;
import fr.afcepf.ai89.esharing.entity.TypeAem;

public class BusinessApprovisionnerCriteres implements
		IBusinessApprovisionnerCriteres {

	@Override
	public List<FrRegion> getRegions() {
		
		List<FrRegion> regions = new ArrayList<FrRegion>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrRegion proxyDataFrRegion = null;
			
			try {
				
				proxyDataFrRegion = (IDAOFrRegion)ctx.lookup("java:global/ESharingPhase1/DAOFrRegion!fr.afcepf.ai89.esharing.data.IDAOFrRegion");
			
			}
			catch (Exception e ) {
				
				proxyDataFrRegion = (IDAOFrRegion)ctx.lookup("ESharingPhase1/DAOFrRegion!fr.afcepf.ai89.esharing.data.IDAOFrRegion");
			
			}
			
			regions = proxyDataFrRegion.getFrRegions();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return regions;

	}

	@Override
	public List<FrDepartement> getDepts() {

		List<FrDepartement> depts = new ArrayList<FrDepartement>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrDepartement proxyDataFrDepartement = null;
			
			try {
				
				proxyDataFrDepartement = (IDAOFrDepartement)ctx.lookup("java:global/ESharingPhase1/DAOFrDepartement!fr.afcepf.ai89.esharing.data.IDAOFrDepartement");
			
			}
			catch (Exception e ) {
				
				proxyDataFrDepartement = (IDAOFrDepartement)ctx.lookup("ESharingPhase1/DAOFrDepartement!fr.afcepf.ai89.esharing.data.IDAOFrDepartement");
			
			}
			
			depts = proxyDataFrDepartement.getDepts();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return depts;

	}

	@Override
	public List<FrDepartement> getDepts(FrRegion reg) {
		
		List<FrDepartement> depts = new ArrayList<FrDepartement>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrDepartement proxyDataFrDepartement = null;
			
			try {
				
				proxyDataFrDepartement = (IDAOFrDepartement)ctx.lookup("java:global/ESharingPhase1/DAOFrDepartement!fr.afcepf.ai89.esharing.data.IDAOFrDepartement");
			
			}
			catch (Exception e ) {
				
				proxyDataFrDepartement = (IDAOFrDepartement)ctx.lookup("ESharingPhase1/DAOFrDepartement!fr.afcepf.ai89.esharing.data.IDAOFrDepartement");
			
			}
			
			depts = proxyDataFrDepartement.getDepts(reg);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return depts;

	}

	@Override
	public List<FrCommune> getCommunes(FrDepartement dept) {

		List<FrCommune> communes = new ArrayList<FrCommune>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrCommune proxyDataFrCommune = null;
			
			try {
				
				proxyDataFrCommune = (IDAOFrCommune)ctx.lookup("java:global/ESharingPhase1/DAOFrCommune!fr.afcepf.ai89.esharing.data.IDAOFrCommune");
			
			}
			catch (Exception e ) {
				
				proxyDataFrCommune = (IDAOFrCommune)ctx.lookup("ESharingPhase1/DAOFrCommune!fr.afcepf.ai89.esharing.data.IDAOFrCommune");
			
			}
			
			communes = proxyDataFrCommune.getCommunes(dept);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return communes;

	}

	@Override
	public List<FrCommune> getCommunes(int codePostal) {
		
		List<FrCommune> communes = new ArrayList<FrCommune>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrCodePostalAsso proxyDataFrCodePostalAsso = null;
			
			try {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("java:global/ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			catch (Exception e ) {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			
			communes = proxyDataFrCodePostalAsso.getCommunes(codePostal);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return communes;

	}

	@Override
	public List<Integer> getCodesPostaux() {

		List<Integer> codesPostaux = new ArrayList<Integer>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrCodePostalAsso proxyDataFrCodePostalAsso = null;
			
			try {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("java:global/ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			catch (Exception e ) {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			
			codesPostaux = proxyDataFrCodePostalAsso.getCodesPostaux();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return codesPostaux;
		
	}

	@Override
	public List<Integer> getCodesPostaux(FrDepartement dept) {

		List<Integer> codesPostaux = new ArrayList<Integer>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrCodePostalAsso proxyDataFrCodePostalAsso = null;
			
			try {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("java:global/ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			catch (Exception e ) {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			
			codesPostaux = proxyDataFrCodePostalAsso.getCodesPostaux(dept);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return codesPostaux;

	}

	@Override
	public List<Integer> getCodesPostaux(FrCommune commune) {

		List<Integer> codesPostaux = new ArrayList<Integer>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOFrCodePostalAsso proxyDataFrCodePostalAsso = null;
			
			try {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("java:global/ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			catch (Exception e ) {
				
				proxyDataFrCodePostalAsso = (IDAOFrCodePostalAsso)ctx.lookup("ESharingPhase1/DAOFrCodePostalAsso!fr.afcepf.ai89.esharing.data.IDAOFrCodePostalAsso");
			
			}
			
			codesPostaux = proxyDataFrCodePostalAsso.getCodesPostaux(commune);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return codesPostaux;

	}

	@Override
	public FrRegion getRegion(int idRegion) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FrDepartement getDept(String idDept) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FrCommune trouverCommune(String idDept, int idCommune) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FrCodePostalAsso associerCommuneCP(FrCommune commune, int codePostal) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<CategorieAem> getCategories() {
		
		List<CategorieAem> cats = new ArrayList<CategorieAem>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCategorieAem proxyDataCategorieAem = null;
			
			try {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("java:global/ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			catch (Exception e ) {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			
			cats = proxyDataCategorieAem.getCats();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return cats;

	}

	@Override
	public List<CategorieAem> getMasterCategories() {

		List<CategorieAem> cats = new ArrayList<CategorieAem>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCategorieAem proxyDataCategorieAem = null;
			
			try {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("java:global/ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			catch (Exception e ) {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			
			cats = proxyDataCategorieAem.getCatsRacines();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return cats;
	
	}

	@Override
	public List<CategorieAem> getSousCategories(CategorieAem cat) {

		List<CategorieAem> cats = new ArrayList<CategorieAem>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCategorieAem proxyDataCategorieAem = null;
			
			try {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("java:global/ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			catch (Exception e ) {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			
			cats = proxyDataCategorieAem.getSousCats(cat);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return cats;

	}

	@Override
	public List<TypeAem> getTypesAem() {

		List<TypeAem> types = new ArrayList<TypeAem>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOTypeAem proxyDataTypeAem = null;
			
			try {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("java:global/ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			catch (Exception e ) {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			
			types = proxyDataTypeAem.getTypesAems();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return types;

	}

	@Override
	public List<TypeAem> getTypesAem(CategorieAem cat) {

		List<TypeAem> types = new ArrayList<TypeAem>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOTypeAem proxyDataTypeAem = null;
			
			try {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("java:global/ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			catch (Exception e ) {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			
			types = proxyDataTypeAem.getTypesAems(cat);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return types;

	}

	@Override
	public List<Marque> getMarques() {
		
		List<Marque> marques = new ArrayList<Marque>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOMarque proxyDataMarque = null;
			
			try {
				
				proxyDataMarque = (IDAOMarque)ctx.lookup("java:global/ESharingPhase1/DAOMarque!fr.afcepf.ai89.esharing.data.IDAOMarque");
			
			}
			catch (Exception e ) {
				
				proxyDataMarque = (IDAOMarque)ctx.lookup("ESharingPhase1/DAOMarque!fr.afcepf.ai89.esharing.data.IDAOMarque");
			
			}
			
			marques = proxyDataMarque.getMarques();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return marques;
		
	}

	@Override
	public List<NoteAvis> getNotesAvis() {
		
		List<NoteAvis> notes = new ArrayList<NoteAvis>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAONoteAvis proxyDataNoteAvis = null;
			
			try {
				
				proxyDataNoteAvis = (IDAONoteAvis)ctx.lookup("java:global/ESharingPhase1/DAONoteAvis!fr.afcepf.ai89.esharing.data.IDAONoteAvis");
			
			}
			catch (Exception e ) {
				
				proxyDataNoteAvis = (IDAONoteAvis)ctx.lookup("ESharingPhase1/DAONoteAvis!fr.afcepf.ai89.esharing.data.IDAONoteAvis");
			
			}
			
			notes = proxyDataNoteAvis.getNotesAvis();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return notes;

	}

	@Override
	public List<LibelleSousAvis> getLibelleSousAvis() {
		
		List<LibelleSousAvis> libelles = new ArrayList<LibelleSousAvis>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOLibelleSousAvis proxyDataLibelleSousAvis = null;
			
			try {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("java:global/ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			catch (Exception e ) {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			
			libelles = proxyDataLibelleSousAvis.getLibellesSA();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return libelles;

	}

	@Override
	public List<MotivationAnnulation> getMotivsAnnul() {
		
		List<MotivationAnnulation> motsAnn = new ArrayList<MotivationAnnulation>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOMotivationAnnulation proxyDataMotivationAnnulation = null;
			
			try {
				
				proxyDataMotivationAnnulation = (IDAOMotivationAnnulation)ctx.lookup("java:global/ESharingPhase1/DAOMotivationAnnulation!fr.afcepf.ai89.esharing.data.IDAOMotivationAnnulation");
			
			}
			catch (Exception e ) {
				
				proxyDataMotivationAnnulation = (IDAOMotivationAnnulation)ctx.lookup("ESharingPhase1/DAOMotivationAnnulation!fr.afcepf.ai89.esharing.data.IDAOMotivationAnnulation");
			
			}
			
			motsAnn = proxyDataMotivationAnnulation.getMotsAnnuls();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return motsAnn;

	}

	@Override
	public List<MotivationRefus> getMotivsRefus() {
		
		List<MotivationRefus> motsRef = new ArrayList<MotivationRefus>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOMotivationRefus proxyDataMotivationRefus = null;
			
			try {
				
				proxyDataMotivationRefus = (IDAOMotivationRefus)ctx.lookup("java:global/ESharingPhase1/DAOMotivationRefus!fr.afcepf.ai89.esharing.data.IDAOMotivationRefus");
			
			}
			catch (Exception e ) {
				
				proxyDataMotivationRefus = (IDAOMotivationRefus)ctx.lookup("ESharingPhase1/DAOMotivationRefus!fr.afcepf.ai89.esharing.data.IDAOMotivationRefus");
			
			}
			
			motsRef = proxyDataMotivationRefus.getMotsRefuss();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return motsRef;

	}

	@Override
	public List<Civilite> getCivilites() {
		
		List<Civilite> civs = new ArrayList<Civilite>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCivilite proxyDataCivilite = null;
			
			try {
				
				proxyDataCivilite = (IDAOCivilite)ctx.lookup("java:global/ESharingPhase1/DAOCivilite!fr.afcepf.ai89.esharing.data.IDAOCivilite");
			
			}
			catch (Exception e ) {
				
				proxyDataCivilite = (IDAOCivilite)ctx.lookup("ESharingPhase1/DAOCivilite!fr.afcepf.ai89.esharing.data.IDAOCivilite");
			
			}
			
			civs = proxyDataCivilite.getCivs();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return civs;
		
	}

	@Override
	public List<Complement> getComplements() {
		
		List<Complement> comps = new ArrayList<Complement>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOComplement proxyDataComplement = null;
			
			try {
				
				proxyDataComplement = (IDAOComplement)ctx.lookup("java:global/ESharingPhase1/DAOComplement!fr.afcepf.ai89.esharing.data.IDAOComplement");
			
			}
			catch (Exception e ) {
				
				proxyDataComplement = (IDAOComplement)ctx.lookup("ESharingPhase1/DAOComplement!fr.afcepf.ai89.esharing.data.IDAOComplement");
			
			}
			
			comps = proxyDataComplement.getCompsAds();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return comps;
		
	}

	@Override
	public CategorieAem getSuperCategorie(CategorieAem cat) {
		
		CategorieAem superChat = new CategorieAem();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCategorieAem proxyDataCategorieAem = null;
			
			try {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("java:global/ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			catch (Exception e ) {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			
			superChat = proxyDataCategorieAem.getSuper(cat);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return superChat;

	}

	@Override
	public CategorieAem getCategorieAem(int idCat) {

		CategorieAem cat = new CategorieAem();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOCategorieAem proxyDataCategorieAem = null;
			
			try {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("java:global/ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			catch (Exception e ) {
				
				proxyDataCategorieAem = (IDAOCategorieAem)ctx.lookup("ESharingPhase1/DAOCategorieAem!fr.afcepf.ai89.esharing.data.IDAOCategorieAem");
			
			}
			
			cat = proxyDataCategorieAem.getCatAem(idCat);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return cat;

	}

	@Override
	public TypeAem getType(int idType) {

		TypeAem type = new TypeAem();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOTypeAem proxyDataTypeAem = null;
			
			try {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("java:global/ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			catch (Exception e ) {
				
				proxyDataTypeAem = (IDAOTypeAem)ctx.lookup("ESharingPhase1/DAOTypeAem!fr.afcepf.ai89.esharing.data.IDAOTypeAem");
			
			}
			
			type = proxyDataTypeAem.getTypeAem(idType);
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return type;

	}

	@Override
	public CategorieAem getParentCategorie(TypeAem type) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<LibelleSousAvis> getLibelleSousAvisSurPreteur() {
		
		List<LibelleSousAvis> libelles = new ArrayList<LibelleSousAvis>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOLibelleSousAvis proxyDataLibelleSousAvis = null;
			
			try {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("java:global/ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			catch (Exception e ) {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			
			libelles = proxyDataLibelleSousAvis.getLibellesSAsurPreteur();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return libelles;

	}

	@Override
	public List<LibelleSousAvis> getLibelleSousAvisSurEmprunteur() {
		
		List<LibelleSousAvis> libelles = new ArrayList<LibelleSousAvis>();
		
		try {
			
			Context ctx;
			ctx = new InitialContext();
			IDAOLibelleSousAvis proxyDataLibelleSousAvis = null;
			
			try {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("java:global/ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			catch (Exception e ) {
				
				proxyDataLibelleSousAvis = (IDAOLibelleSousAvis)ctx.lookup("ESharingPhase1/DAOLibelleSousAvis!fr.afcepf.ai89.esharing.data.IDAOLibelleSousAvis");
			
			}
			
			libelles = proxyDataLibelleSousAvis.getLibellesSAsurEmprunteur();
				
		}
		catch (NamingException e) {
			
			e.printStackTrace();
			
		}
		
		return libelles;

	}

}
